<?php
session_start();
if(!isset($_SESSION['uid']))
 	{?>
		<script type="text/javascript">
			window.location="error.php";
		</script>
	<?php
 	}else
 		{
 			include_once 'topStaticBar.php';
 			?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<h1 align="center">Add Make Library Page</h1>
	<form name="form" method="post" action="addMakeServer.php">
		<input type="hidden" name="stock_id" value="<?php echo $_REQUEST['stock_id']?>">
		<table border="0" align="center">
		<tr>
			<td align="right">
				Make
			</td>
			<td>
				<input type="text" name="make" style="width: 400px">
			</td>
		</tr>
		<tr>
			<td align="center">
				<input type="submit" value="Add Make">
			</td>
		</tr>
		
		</table>
		</form>
		<h2 align="center">Current Makes</h2>
<table border="1" align="center">
<th>Make</th>
<th>Delete</th>
<?php
			include_once 'dataBaseConnectivityFile.php';
			$sql_get=mysql_query("select * from filters where MAKE is not null");
 			if (!$sql_get)
 			{
    			echo 'Could not run query: '.mysql_error();
			}

			while ($db_field=mysql_fetch_assoc($sql_get))
			{?>
				<tr align="center">
					<td align="right">
						<?php echo $db_field["MAKE"]; ?>						
					</td>
					<td align="left">
						<a href="updateMake.php?update=<?php echo $db_field["FILTER_ID"]?>">Delete</a>
					</td>
				</tr>
		<?php 		
			}
 ?>
</table>		 		
 	<?php 	
 		}
 	?>